#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
void reverse(char* l, char* r)
{
	assert(l && r);
	while (l < r)
	{
		char tmp = *l;
		*l = *r;
		*r = tmp;
		l++; 
		r--;
	}
}
int main()
{
	char arr[100] = { 0 };
	gets(arr);
	int len = strlen(arr);
	char* left = arr;
	char* right = arr + len - 1;
	reverse(left, right);
	char* sta = arr;
	char* cur = arr;
	while (*cur!='\0')
	{
		while (*cur != ' '&& *cur != '\0')
		{
			cur++;
		}
		reverse(sta, cur - 1);
		sta = cur + 1;
		if (*cur != '\0')
			cur++;
	}


	printf("%s\n", arr);
	return 0;
}